#ifndef BTFORM_H
#define BTFORM_H

#include <QWidget>
#include<QPropertyAnimation>

namespace Ui {
class BtForm;
}

class BtForm : public QWidget
{
    Q_OBJECT

public:
    explicit BtForm(QWidget *parent = nullptr);
    ~BtForm();

    void setIconAndText(const QString &icon,const QString &btText,int pageId);
    int getPageId()const;
    void clearBackground();

signals:
    void btClick(int id);

protected:
    void mousePressEvent(QMouseEvent *event);
    void enterEvent(QEvent*event);
    void leaveEvent(QEvent*event);

private:
    void setAnimal();
    void stopAnimal();
    void startAnimal();



protected:
    static BtForm*currentActivateBt;

private:

    Ui::BtForm *ui;
    int pageID;
    QPropertyAnimation *line1Animal;
    QPropertyAnimation *line2Animal;
    QPropertyAnimation *line3Animal;
    QPropertyAnimation *line4Animal;
};

#endif // BTFORM_H
